package com.swallow.cloud.common.model;

import java.io.Serializable;

/**
 * 通用的异步参数返回
 * @Author: L.swallow
 * @Date: 2019/3/19 15:08
 */
public class R implements Serializable {

    private static final long serialVersionUID = 1L;

    private boolean success=true;

    private String msg;

    private Object obj;

    public R(boolean success, String msg) {
        this.success=success;
        this.msg=msg;
    }
    public R() {
    }

    public R(Object obj) {
        this.obj=obj;
    }

    public static R  success(){
        return new R();
    }
    public static R  success(Object obj){
        R r=  new R(obj);
        return r;
    }

    public static R  error(String msg){
        return new R(false,msg);
    }


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
}
